#include "Algorithm/differSum.h"

float adc_compensate;
float horizontal;
float oblique;

float differSum(float a,float b)
{
    return (a-b)/(a+b);
}

float differSumWithParm(float hl,float hr,float ol,float oright)
{
   float result = 0.0f;
   float sub1 = hl - hr;
   float sub2 = ol - oright;
   float add1 = hl + hr;
   float add2 = ol + oright;
   result = adc_compensate + (sub1 * horizontal + sub2 * oblique) / (add1 * horizontal + add2 * oblique);
   return result;
}
